﻿<#escape x as x?html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录界面</title>
	<link href="${rc.contextPath}/Resources/style/style.css" rel="stylesheet" type="text/css" />
    <script src="${rc.contextPath}/Resources/js/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
	    String.prototype.trim = function () {
			return this .replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		}
        function submitForm() {
        	if ($("#textfield2").val() == null || $("#textfield2").val().trim() == "") {
        		alert("账户不能为空！");
        		return;
        	}
        	if ($("#textfield").val() == null || $("#textfield").val().trim() == "") {
        		alert("密码不能为空！");
        		return;
        	}
            $.post("user/login",
                {
                    username: $("#textfield2").val(),
                    password: $("#textfield").val()
                },
                function (data) {
                    if (data.result == 0) {
                        location.href = "login.html";
                    } else {
                        location.href = "main";
                    }
                });
        }
    </script>
<style type="text/css">
#apDiv1 {
	position:relative;
	left:530px;
	top:250px;
	width:351px;
	height:121px;
	z-index:1;
}
</style>
</head>

<body class="loding">
<div class="login-body">
    <div id="apDiv1">
        <label for="textfield"></label>
        <label for="textfield2"></label>
        <input type="text" name="textfield2" id="textfield2" />
        <input type="password" name="textfield" id="textfield" />
        
        <a class="button round dark position1" onclick="submitForm();">登&nbsp;录</a>
        <a class="button round dark position2" href="#">关&nbsp;闭</a>
     </div>
</div>
</body>
</html>
</#escape>